Skip to content

Conversation

@bigbes
Copy link
Collaborator

@bigbes bigbes commented Sep 30, 2025

  • implemented etcd driver (backend) for basic storage
  • used etcd testing.LazyCluster for integration testing
  • modified .golangci.yaml to add new library exclusion

Part of #TNTP-4189

@bigbes bigbes force-pushed the bigbes/tntp-4189-etcd-driver branch from 1ecc345 to 562c5bc Compare November 5, 2025 23:36
@coveralls
Copy link

coveralls commented Nov 5, 2025

Pull Request Test Coverage Report for Build 19138272403

Details

  • 163 of 1201 (13.57%) changed or added relevant lines in 7 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-3.2%) to 18.858%

Changes Missing Coverage Covered Lines Changed/Added Lines %
driver/etcd/operation.go 20 26 76.92%
driver/etcd/predicate.go 37 51 72.55%
driver/etcd/etcd.go 101 129 78.29%
internal/testing/t.go 0 42 0.0%
internal/mocks/etcd_client_mock.go 0 222 0.0%
internal/mocks/etcd_txn_mock.go 0 726 0.0%
Files with Coverage Reduction New Missed Lines %
driver/etcd/etcd.go 1 77.86%
internal/testing/t.go 2 0.0%
Totals Coverage Status
Change from base Build 19101577872: -3.2%
Covered Lines: 548
Relevant Lines: 2906

💛 - Coveralls

@bigbes bigbes marked this pull request as ready for review November 5, 2025 23:40
@bigbes bigbes force-pushed the bigbes/tntp-4189-etcd-driver branch from 562c5bc to 61c9309 Compare November 6, 2025 12:51
* implemented etcd driver (backend) for basic storage
* used etcd `testing.LazyCluster` for integration testing
* modified .golangci.yaml to add new library exclusion

Part of #TNTP-4189
@bigbes bigbes force-pushed the bigbes/tntp-4189-etcd-driver branch from 61c9309 to 7c76d2e Compare November 6, 2025 14:05
return tx.Response{}, fmt.Errorf("failed to convert then operations: %w", err)
}

txn = txn.Then(thenEtcdOps...)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the only purpose of returned Txn in If/Then/Else is to be able to write one-liner txn.If().Then().Else().Commit(), so it seems this assignment is useless

Suggested change
txn = txn.Then(thenEtcdOps...)
txn.Then(thenEtcdOps...)

return tx.Response{}, fmt.Errorf("failed to convert else operations: %w", err)
}

txn = txn.Else(elseEtcdOps...)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

func TestPredicateToCmp(t *testing.T) {
t.Parallel()

tests := []struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd suggest to use map[string]struct for tests table instead of slice as it has some advantages w/o additional complexity (https://go.dev/wiki/TableDrivenTests#using-a-map-to-store-test-cases).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants